/* Message Component Styles */

.messageContainer {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 90vw;
}

.message {
  border-radius: 12px;
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  position: relative;
  overflow: hidden;
}

.message::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 12px;
  padding: 1px;
  background: transparent;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: exclude;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

.messageContent {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  position: relative;
  z-index: 2;
}

.messageIcon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  transition: all 0.3s ease;
}

.messageText {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text-primary);
  letter-spacing: -0.025em;
}

.closeButton {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px;
  cursor: pointer;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}

.closeButton:hover {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 亮色主题下关闭按钮样式 */
[data-theme="light"] .closeButton {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .closeButton:hover {
  background: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 暗色主题下关闭按钮样式 */
[data-theme="dark"] .closeButton {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .closeButton:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 亮色主题下的渐变消息样式 - 统一紫色色系 */
[data-theme="light"] .success {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .success::before {
  background: transparent;
}

[data-theme="light"] .success .messageIcon {
  color: #06b6d4;
}

[data-theme="light"] .success .messageText {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

[data-theme="light"] .error {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .error::before {
  background: transparent;
}

[data-theme="light"] .error .messageIcon {
  color: #ef4444;
}

[data-theme="light"] .error .messageText {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

[data-theme="light"] .warning {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .warning::before {
  background: transparent;
}

[data-theme="light"] .warning .messageIcon {
  color: #f59e0b;
}

[data-theme="light"] .warning .messageText {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

[data-theme="light"] .info {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .info::before {
  background: transparent;
}

[data-theme="light"] .info .messageIcon {
  color: #3b82f6;
}

[data-theme="light"] .info .messageText {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

/* 暗色主题下的渐变消息样式 */
[data-theme="dark"] .success {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border: 1px solid rgba(6, 182, 212, 0.3);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .success::before {
  background: transparent;
}

[data-theme="dark"] .success .messageIcon {
  color: #06b6d4;
}

[data-theme="dark"] .success .messageText {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

[data-theme="dark"] .error {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .error::before {
  background: transparent;
}

[data-theme="dark"] .error .messageIcon {
  color: #ef4444;
}

[data-theme="dark"] .error .messageText {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

[data-theme="dark"] .warning {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .warning::before {
  background: transparent;
}

[data-theme="dark"] .warning .messageIcon {
  color: #f59e0b;
}

[data-theme="dark"] .warning .messageText {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

[data-theme="dark"] .info {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .info::before {
  background: transparent;
}

[data-theme="dark"] .info .messageIcon {
  color: #3b82f6;
}

[data-theme="dark"] .info .messageText {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

/* 位置样式 */
.top-center {
  /* 默认位置，已在 .messageContainer 中定义 */
}

.top-right {
  top: 20px;
  right: 20px;
  left: auto;
  transform: none;
}

.bottom-center {
  top: auto;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.bottom-right {
  top: auto;
  bottom: 20px;
  right: 20px;
  left: auto;
  transform: none;
}

/* 动画效果 */
.entering {
  animation: messageSlideIn 0.3s ease-out;
}

.leaving {
  animation: messageSlideOut 0.2s ease-in;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes messageSlideOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}



/* 响应式设计 */
@media (max-width: 768px) {
  .messageContainer {
    top: 64px;
    left: 16px;
    right: 16px;
    transform: none;
    max-width: none;
  }

  .message {
    min-width: auto;
    max-width: none;
  }

  .messageContent {
    padding: 10px 14px;
  }

  .messageText {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .messageContainer {
    top: 56px;
    left: 12px;
    right: 12px;
  }

  .messageContent {
    padding: 8px 12px;
    gap: 8px;
  }

  .messageText {
    font-size: 12px;
  }

  .messageIcon {
    width: 16px;
    height: 16px;
  }
}
